// Copyright 2010 Alexandre Tristan St-Cyr <tristan.stcyr@gmail.com>

package com.codeplex.loadjava;

import java.sql.SQLException;


interface IJavaRepository extends IRepository {
	
	static int ACC_PUBLIC = 0;
	
	static int ACC_PROTECTED = 1;
	
	static int ACC_PRIVATE = 2;
	
	static int ACC_DEFAULT = 3;
	
	void insertClassDefinition(
			long id,
			String signature,
			boolean isInterface, 
			boolean isAbstract, 
			boolean isFinal,
			boolean isPublic,
			boolean isSuper,
			boolean isAnnotation,
			boolean isEnum,
			boolean isSynthetic,
			long superClassTypeId,
			Long outerClass, String packageName) throws SQLException;
	
	void executeBatchInserts() throws SQLException;

	void insertClass(long id, String name) throws SQLException;

	void insertField(
			long id, 
			long classId, 
			String fieldName, 
			Long typeId) throws SQLException;
	
	void insertFieldDefinition(
			long id,
			String name,
			String signature,
			long typeId,
			int access,
			boolean isStatic,
			boolean isFinal,
			boolean isVolatile,
			boolean isTransient) throws SQLException;
	
	void insertType(
			long id, 
			char kind, 
			int arrayDimensions, 
			Long classId, 
			String descriptor) throws SQLException;

	void insertMethod(
			long id, 
			String methodName, 
			String descriptor, 
			long classid) throws SQLException;

	void insertFieldReference(long methodId, long fieldId) throws SQLException;

	void insertMethodDefinition(
			long methodId, 
			int access, 
			boolean isSynchronized, 
			boolean isNative,
			boolean isAbstract, 
			boolean isStrict , 
			String signature) throws SQLException;

	void insertMethodInvocation(long caller, long callee) throws SQLException;

	void insertInterfaceImplementation(long implementationId, long interfaceId) throws SQLException;

	void insertMethodParameter(int index, long methodId, long typeId) throws SQLException;
}
